package liumengbaio.lolzhangyoubao.Activity.Activity;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.widget.TextView;

import liumengbaio.lolzhangyoubao.R;

/**
 * 占卜界面
 * Created by lanouhn on 16/9/3.
 */
public class MoreDivineActivity extends AppCompatActivity {

    private TextView title,back;
    private WebView mWebView;
    private String url="http://webapp.zhangyoubao.com/divination/mobile/index?gid=5&token=1285c08b612411d0bfc35f213eb5d92a73&user_id=15863305&appName=lol";

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.more_heromoment);
        initView();
        initData();
        initEvent();
    }

    private void initView() {
        title = (TextView) findViewById(R.id.more_title);
        back= (TextView) findViewById(R.id.more_back);
        mWebView= (WebView) findViewById(R.id.more_webView);
    }

    //设置上方标题
    private void initData() {
        title.setText("占卜");

        WebSettings mWebSettings=mWebView.getSettings();
        mWebSettings.setJavaScriptEnabled(true);
        mWebView.loadUrl(url);
    }
    private void initEvent(){
        back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }
}
